Minor code cleanup.
Math fixes for 64bit.
Minor math tuning.
Merge pull request #5 from fsiu/initial

Initial