Revised code in IndexWindow and DatabaseWindow.