Bug fixes in the double precision version. Still not working!