Fixed stack spilling, added stack test