fixes lint + karma tests to return code behaviour