Fix options being undefined in close-fn.