Fix integer devision error. Fixes #57, #56.