Improve stack handling.