Fixing some of the problems in qunit tests