Fixed leaks
Fixed passed variable
Fixed uninitialized value
Fixed a bug in reading in of temperature in histogram
Passing by reference and not by value

(asked by Gareth)
Fixed regtest
Refixed issue with non-initialized variable
Merge branch 'v2.1-valgrind-fix' into v2.1