Changes to fit latest plugin development API version