SolutionHistory updates from Vikram Garg

Unless I've broken his patch, this should make the SolutionHistory
behavior much more robust