Fix some SQL Errors.