Is to_int correct here, or should this use convert_type?