Improved plugin handling