Added math utils class and fixed some warnings.