Small improvements to task switching