Why does computing g^a * g^{-a} with the PBC library result in zero?

My example code is as follows:

 /*
*  Example 1
*  1) Calculate g^a
*  2) calculate g^{-a}
*  3) multiply g^a * g^{-a}
*
*/


Note: here pub->p is a type A pairing.

element_t g, gA,gInverseA, a;

element_init_G1(g,pub->p);
element_init_G1(gA,pub->p);
element_init_G1(gInverseA,pub->p);

element_init_Zr(a,pub->p);

element_random(g);
element_random(a);

element_pow_zn(gA,a);
element_invert(gInverseA,gA);

element_mul(gInverseA,gInverseA,gA);
element_printf("\nValue %B",gInverseA);


Why does it output zero?

-
First the obvious: have you checked that element_mul is designed to allow its result to be one of its arguments? Or tried to setup a specific result variable? – fgrieu Apr 22 '14 at 6:50
Also, doesn't element_pow_zn take three parameters? – poncho Apr 22 '14 at 10:41