Markets consolidated on Wednesday while benchmark indices ended flat with negative bias for second day in a row. The BSE Sensex ended at 51,309.39, down 9.69 points. The 50-share index Nifty closed at 15,106.50, down 2.80 points.Among sectors, Realty, Auto and Pharma indices fared well and Banks were weak.