[fix] set length of array to 0 as that is the proper way
[test] add tests for destroy method in various cases