Fix possible descriptors leak on error in intialization