Check the type of universal id before getting its id.  Should resolve bug #2137
Simplify detecting whether a universal id represents a referenceable type.
Use Qt exit function rather than system one.
Merge remote-tracking branch 'cc9cii/master'