Fixed some indexing issues with line scan

Now with 100% less seg faults