Weird template errors.

Switching versions of gcc now that I'm back on the mac has done strange
things. Need to unpick the tangle of types a little.