Fix upvalue closure implementation of the previous commit