Heapless fixes and support for switch statement