Fixed some errors and finished plugin manager