Fix for #1451

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