Changes to support windows with over 65535 lines