Added plug-in load protection routines. Fixes #142