Fixed sqlite compatibility with atomic
Fixed a few pep8 issues