Probably fixes #348. I'm unsure of exactly how to test, since it depends on GC.