Fixed plugin API and python robustness