Addressed #341 in test_bug_minimal branch - just this one commit could possibly be applied to master