tentatively fixed bug
fixes tests for this bug
Merge branch 'hotfix/pinho'