Fix buy/sell miner fee calculation

Addresses #1100