Merge "Terminate loop properly when cursor window is full." into mnc-dev