There is an else-statement missing:

    else
        nPayFee = nTransactionFee;

Currently, if AllowFree is true and nTransactionFee > 0, coin control shows zero fee. But this is wrong. Must show nTransactionFee.