Fix off-by-one error
Pass array size explicitly (info is lost in pointer-conversion). Fix typos
Edit testing sandbox
Add memory functions for testability