Add tests and update import