Add some validation and more tests