Manchester City survived a scare to put their poor away form behind them with a 3-2 win over West Brom at the Hawthorns.