Fix float equality comparison

Also restructured incorrect return statement