Fixes issue with visual studio not defining M_PI in math.h. Fixed all compiler warnings.