Fix crash due to a division of a str, adding casting to float