Fixed up some problems. Updated unit tests. Unit tests are now run in isolation