Fixed typo, renamed variables, some pep8 fixes