A fix to make the getCollections method more efficient after the fix whe...

...re type information could be lost.