Add branch coverage.

Needs refactoring.