Style fixes, using autopep8
Fix typo that was making edit_notes not work
Factor out into a utility method