Make plugin.py backwards compatible with toolkits
Fix missing parentheses warnings from clang