fixed caching bug and related issues

I still find the ``foo[:] = []`` syntax worrying. Any reason to mutate the list in-place like this instead of creating a new empty list? The elements of the list get garbage collected the same either way...