Fix handling of maps with invalid quality
Merge