Fixed karma tests and JSLint