Pedro's plugin fixes