Additions and one bug fix (BN_mod_inverse).