Fix closures to make them properly usable