Added unit tests to test new behaviour