Fix warnings

I fixed all the warnings I could squeeze out of as many compilers as I could get my hands on.