fix issue 52

I believe this is the right fix, and although this fix belongs in bdb.py, lets test it out in pudb first.