Fix bug where integer division was used instead of floating point
This caused empty output.
Thanks to Nicu Badescu for the persistent bug report