Minor cleanup of the closure code