Bugfix + test case