Fixed logic for getting attribute from resolveModule.
Simplified logic of extensionMatches.