small bugfix and new test case for it