fixes to support alternate database