Made small fixes to fix DBselect.

The new, more pythonic if/else setup was not quite right, but it's good now.