Removed reference to $timeout.
Fixed a old fix that did not get applied to this branch.
Fixed typo in variable name.