fixed with jshint
brought tests up-to-date