Byte compile warnings

I think most of the changes are pretty good. The ones to the main core code might be controversial. Let me know what you think about those changes.