Fixed bug causing rows to be wrongly copied (see #67)