Use correct contexts in creating new elements in the scheduler