Fixed a few things including Karma/Jasmine tests