Minor cleanup and pyflakes/pep8
Better create_buf handling. This should fix @cap10morgan's issue with emacs.