Minor fixes

- pep8 fixes
- refactoring: renamed attribute s in session
- fixed redefinition of built-in id