Two fixes backported from RQ