Pad code generation cleanup; num division bugfixes (need Math.floor)