-- Fixed bug in removing redundant rows