Added more validation to dictionaries