[src] loop changes
[src][test] Fixed a bug where a newly allocated list would not append values; added in Check testing framework