Fix floating-point math to actually use floating point numbers
Change some more odd double vs. int stuff
Merge remote-tracking branch 'dda/pr/1015' into dda-master