More cleaning out of the Db class and prevention of multiple connections caused by wakeups and escapes.