fixed: crash when trying to create document based on device with zero size
fixed: device is lost after throwing uncatched exception from extension module