Fixed most of the tests

There are still some testing issues.
Created the batch file for restoring the database