Fixed a bug introduced in last commit (using of this in a closure).