new tests and related fixes