Minor fix to the user template lookup

This makes sure that an exception gets thrown if a directory
has been moved out of the user group and therefore keeps tests
like ImportLibraryTest much happier
Improvements from Mark's review