Cache Length checks

Fixes #196