added 'def' plugin and some related fixes