fixes to swapdb