Pull request for issue #116

This was originally for issue #116, but got sidetracked into fixing problems with the test running consistently.