Applying code changes as suggested by Anton.

Fixed 2 failing Jasmine tests. Removed unnecessary console.log() call.
Initializing of variables in a single var statement.