Several bugs fix in stage1.S