Added more validations and tests