Fix Some Compiler Warnings

This fixes some of the compiler warnings produced ATM. Please don't merge until I say, but please do comment and leave any suggestions.

This will partially fix #342.