Pep8 and updated exceptions for subdb.py