Fixed other incompatibilities with recent MySQLdb update