preprocess labels; fixed some syntax