Merge "Fix bad cast when querying remote input history" into sc-dev