Added tests project for unit tests and fixed minor bugs.