Bugfix for #383: Strange behavior of cloneRow with multiple tables

Added a check for the end of table, for correct processing of multiple tables with spanned rows