more fixes and workarounds for running inside plugin host