Removed macros, made behaviour sane and removed a lot of warnings