Made Foreign Key get_db_prep_save value check more robust