fixed bugs in preprocessor