fixing initialisation and deletion of pointers
fixing use of potentially invalid references
cleaning up memory leak, not deleting pointer in destructor
Merge pull request #5159 from Sam-Harper/egbugfixes-valgrindErrs72X

Reco -- Egbugfixes valgrind errs72 x