fixed tests and examples from latest code refactor