update tests and fix errors