Regression tests for issue 890

This adds regression tests for 890.  This was fixed, regressed and
accidentally fixed again.  For some reason I failed to add tests the
first time I fixed this bug.  Added tests to verify it doesn't get
regressed again

closes #890
Fixed a unit test issue