Some changes for bn_gf2m.c: better error checking plus some minor