PetPlugin: fixed some stupid mistakes in implementation of #119