Fix type and remove to_int