add tests to reproduce bug #134
fix bug #134