Revert use of div() for the RPM calc
Clean ups to remove some of the compiler warnings