Minor refactoring in make_shared for arrays