Bug fixes

Stack control has a bug that makes program does't recover stack
correctly