Fix / improvement of logic in test case