Fixed erorrs on reinstalling plugin

Fixes #49