Added functional test for this PR

Test will fail under current code and works with the PR.