Reorganized docprops setup code.
Fixed discard warning not displaying.