Adding sanity check back to Trail.getUniqueId
Micro-optimization of Trail unique ID handling