Added initial Jasmine spec, minor tweaks, fix in tests