Fix conversion to int