Switching to mysql.connector, and some other bug fixes