Fix some garbage collection bugs; add stl array example