Fixed almost all MySQL issues.