Merge pull request #2076 from alex/more-branch-coverage

More branch coverage improvements. By virtue of reorganization and a new test