Fixes bugs with larger kstack allocation