Add integration test to show that this PR fixes #472.