Fix MySQL error functions