Check return value of some BN functions.