Fix warnings

Not the most useful PR ever, but because it was a mess to work with -Xlint enabled, I decided to kill most warnings (which are about 400).