Fixed closure bug. Ugly hack inside, we'll come back to this later.