simple fix for issue #531

this commit uses the fact that connection has db set to 0 by default. If
a db value is not present in kwargs, it is defaulted to 0.