add tests to reproduce issue #5