Checking return value pverify, added quad residue test