Features/safer plugin config

Small amount of panic recovery code around calls made into plugin code.