Fixed an unmentionable amount of complaints caused by the CLang compiler.
Squished additional errors and bugs made apparent by CLang.