Update ReferenceData.pm

Updating error checking; modifying to take account of database change;