Fix Strict Mode crash

This will crash in strict mode without this change due to a resource
not being closed error.