Fix int conversion crash