If your piece turned black, you probably got a smut from oxidation. In general, you should not acid pickle, but rather you should use alkaline cleaning. ASM Handbook Volume 5: Surface Engineering gives good information acceptable practices. It is available at:
ASTM has a number of good references with respect to magnesium surface preparation & corrosion:
ASTM D 1732 STANDARD PRACTICE FOR PREPARATION OF MAGNESIUN ALLOY SURFACES FOR PAINTING
ASTM B 879 STANDARD PRACTICE FOR APPLYING NON-ELECTROLYTIC CONVERSION COATINGS ON MAGNESIUM AND MAGNESIUM ALLOYS
ASTM B 480 STANDARD GUIDE FOR PREPARATION OF MAGNESIUM AND MAGNESIUM ALLOYS FOR ELECTROPLATING
B 480 references the standard guide ASTM B 322, which is an excellent reference for all metals
There is a military spec, MIL-M-3171 MAGNESIUM ALLOY, PROCESSES FOR PRETREATMENT AND PREVENTION OF CORROSION ON, that has some information on this subject as well. It has been officially superceded by SAE-AMS-M-3171, but you can still download the last version of this document, free of charge, using ASSIST-Quick Search at