Unit tests fixed for setImmediates