Accuracy on mountain bike rides.

I am using GPS +Glonass on my edge 820. I had suspected things were off mileage wise. Typically, on a 18 mile trail ride, I'm off by at least a 1-2 miles. The length of a particular trail was verified by surveyor wheel and I'm off when comparing to friends on Strava. This past weekend I did what should have been a 50+ 90% singletrack ride. My friend had it pegged at 53 miles, using polar phone app. I however, only had 48. Elevation gain was way off too, even after correcting on Strava. 

Anything I can change or do?