Fixing bugs with ajax test case