Cleanup typed array allocation