Fix MySQL errors functions