Fixed Database Issues

Reordered variable entry to database to ensure keys matched, database
updating