clean up imports
fix #744, blank line skipping in AutoEdit
fix #776