Fix float math bug