Update QUnit definition

Tests added. bug fix.