Tweaked get_data, made more fault-tolerant