Qunit test and source code fix