Fix array printing and freeing
Add more tests for array and object