Added tests to reproduce #166