Update test suite and minor bug fixes