Fix bug causing incorrect selection of bases based on quality score