Improved test suite

see #811