python mode cleanups