Fix bug that allowed visibleLines to return an empty viewport