Fix small offset by replacing float -> double
Fix small shifts (use double)