Resolves #4708 - added unit tests