Added fixes for tests and code, now all relevant tests are passing.