Fix undefined plugindir file resource, poor variable sourcing