Correct bugs in build_database.php