Fixed gain calculator problem

Bit of a fight with the github client, heaps of distraction and no time
delayed me getting back to this. Sorry.