Fixed errors in double to int