Fixed seg fault when drawing lines