Fix password loop in shared file/dir
Fix a few code styles to fit pep8