Fixed some bugs in PreProcessor