Bad int conversion bugfix