- fixes #902
- adds testcases for #902