Fix storage to ensure resources are freed: refs #276