Quote properly to allow more names
Check cache is still valid before using

Use a (relatively) cheap query to check our type system
cache is still valid before using it.