Fixed lp:1308146 - backported from trunk