charj: pup functions and deallocation fix for array library