[PATCH] stack: Improve error checking and exit code handling.