Fixed bugs in preprocessor