fix and improve test suite