Fixed some errors in SQLite and MySQL database scripts