Import fixes for upstream

We've been working on a plugin that uses hookDataImportContentTree for some of our wierd data sources. We ran into a number of undefined variables and missnamed variables and this PR fixes those.