Cleanup

I have enabled some helpful compiler warnings and started to fix some problems, which you find in separate commits. Especially clang was really helpful here. There are still some possible bugs left which I plan to fix later (mostly some sign conversions and conditionally uninitialized variables).