Fix uses of Deferred .then() (bug 864585)