Adapt to work in either cgminer or BFGMiner