Fix warnings and move more stuff to double prec

More double precision arithmetic used. Fixes some minor warnings.