Fixed bug in ResourceManager getResourceFromSubstitutedID() that could
lead to the wrong substituted resource being loaded.