Add failing unit test for case that Bob Walton found, and fix.

See DVPL-1531 in Jira.