Undefined exception fix for old data.

Minor bug fixes for undefined exception if using old data.