Fixed error when running in double precision