fixed compilation errors

and some auto-removing of whitespaces from vim