Added not a string and invalid value checks