Whitespace fixes.
Moves the cleanup method to a local scope.
Adds missing var.
More formatting fixes.