Fix bug in sub window test.