[CB-4036] - added more tests and fixed up some logic