Fix python plugin crash issues.