undefined cached checks.

 Part of #185. Should fix #162 & #163.