Patch for 'NoMethodError: undefined method closed? for Hash'