Fix for #1451

Line codec was using an undefined variable which caused it to throw and exception.

Fixed and added tests for line codecs

Closes #1451