Added better casting for float.