improved test suite, major fixes