Checking whether identifiers are valid