Fix caching/uncaching bug in sdm
Preliminary perception stuff.