Take into account mapping qualities and some debug printing