Add debug information when loading plugin errors (Fixes #711)

Fixes issue #711