Fixed pickle unsaved document regression (#327)