Fix issue calculating index for drawing lines

refs #15