Fix the karma tests

I have honestly no idea what I'm doing here, just fixing the test failure. There might be a way better way to fix it.
Merge pull request #1393 from benallard/patch-4

Fix the karma tests