Added key validation.