Check if unknown document first

Depends on the other two fixes to not require rebasing once these are merged.

Adresses Watson Bug 3622283