Fix for migrations and valid plugin reinstall