PEP 8 style changes
Wrong variable name and close connection when exception is thrown.
Merge pull request #276 from giffels/dbs3-comparision-fix

Dbs3 comparision fix