slight cleanup to plugin functions, prevented a very very unlikely xss