Several improvements in plugin management