Fix issue #1126

@fabpot Is this way of adding the test case is ok for you?