fixed a bunch of careless bugs, plugin activates correctly