TESTS: new test modules plus tiny bug fixes