Incorporate feedback on PR #1054.

- Added comments explaining edge cases.
- Reworked assertion statements in new unit tests.