Fix array append issue and add stack test program