fixed several bugs, still work in progress for PyLint