Additional unit tests

Added more unit tests. Minor clean up of unused code.