Fix compile errors and warnings
Win64 fix: pass 64-bit reals as doubles