fixed some errors that prevented plugin initialisation under python3