fixed float casting bugs