Improve and add godoc comments. Fix a small bug around data priority.