Fix a bunch of warnings

Thanks, CLion!
Remove some unused preprocessor defs/includes
Fix potential segfault if effect is null