Fixed bugs with database, added PGN