Closes #760 with three new test cases.