fixing tests issues and jshint complains