Added missing var statement, removed some debugging output.