Updated Type::getDocument() exception handling #687