Heapless fixes and switch statement support