Made the plugin behave more graceful