[TIMOB-12986] Fixed some bugs surrounding queued functions