Bug fixes

Fixed errors that may occur when generating reports regarding most
heavily edited documents