Add more error codes; reformat lines to be pep8-compliant