WTA Madrid: Halep battles through in Madrid