Incorrect casting of long to double

- Fixes #84