A few compiler warning fixes

Please review as I'm not entirely sure about some of the floats, but it does seem to compile and work correctly.