Fix warnings and move more stuff to double prec

More double precision arithmetic used. Fixes some minor warnings.
Merge pull request #20 from lorrden/master

Fix warnings and move more stuff to double prec