Fix gc bug in array library