Fixes some obvious bugs. Makes pep8 happy