Add more jasmine tests + several fixes