Add tests and increase coverage