Rupee ends mostly flat