Fix wrong mem allocation and initialize variables
Fix for profiler

* Crashes for MPI, this fixes it