Fixed errors in plugin