Fix bug in quality weighted export