change preprocessor def
fix crashes and warnings