Check for validity of d