Fix horrific bug when casting to float