Resolved a bug in row rearranging.