Added logical test before printing error message
Fixed bug when adding historical summary keys for field values