undefined cached checks.

 Part of #185. Should fix #162 & #163.
Merge pull request #189 from oleg8sh/patch-1

undefined cached checks.