Fix bug lp:1334657

This is the same as https://code.launchpad.net/~arthru/ocb-addons/fix-1334657/+merge/224623