Fixed some bad converts of longs to int