More setImmediate fixes that weren't committed in b66b782e

b66b782e630885f1c08ad314fd9df63252b31e5a

Change-Id: Ie5da4717ba85406d63c18df2c9e5b699a13a3b7b
Merge "More setImmediate fixes that weren't committed in b66b782e"