fixed array fail in alloc_ptr_array (thanks anon