Fix for 'undefined index' warnings. Ref #734