Correct bugs in stack_main.c