Fix wrong close handler (#270)