Fix resource qualifier resolution when version qualifiers are included.

Fixes #1086. Closes #1099.