Fixed leaks

(cherry picked from commit 1582340778aed2a6728287c096dd29cf25c8055e)

Conflicts:
	src/tools/BiasRepresentation.cpp
changelog