tests: fixed bug in code