Fix double/float to long comparison