corrected issues with error line handling

when the updateError() was unmodified from returning if the line has an
error (commit a871ca), it was not unmodified completely to the changes
that were made when this was changed (commit dd94ed)

when an error is removed, the rest of the errors were incorrectly being
modified when a line was not deleted and did not have an error

when a line is replaced with an empty line (for example, a line with an
error), the replaceLine() function was supposed to be call the
removeLine() function and return, but it was just calling remove() and
then it moved memory again causing part of the next line to be removed

added a replacement of a line with an error line to encoder test #2 and
modified the test program output to include the offset with an error
line, updated expected results