[PD-dev] fixes for two memory leaks