Fix bug in dependency checker: cache validation.

Should rebuild cache when grammar changes now.