Added new test; little bit of refactoring.