Fixed a bug with the plugins, still further writing of tests is required. Also optimisation is required.