Added new tests, minor fixes