Check that setRow is not negative, fixes #644. (#773)