Added new tests
Various cleanups