Fixed some errors while running patchSql.php: