Added some ROW optimizations(thanks to Hundsbuah)