Fixes to issues identified by Coverity.

This is redundant work - the HistoryStacks should be PODs.