Fix QUnit tests MJ-399

All tests pass.