fix panics in libcollections