Python 2.X compatibility fix

Also changed bad batch to a warning instead of an error.