Fixes.

Fixed a bunch of issues. From simple ones to bad uses of classes that make using this library along with auto-complete impossible or just useless.

There are also some serious bad practice, unused variables and a lot other errors, but i cannot commit as many hours to this to fix it all.

I'll send a report via some other method.