Fixed leaks

(cherry picked from commit 1582340778aed2a6728287c096dd29cf25c8055e)

Conflicts:
	src/tools/BiasRepresentation.cpp
changelog
Merge branch 'v2.0' into v2.1

Conflicts:
	src/tools/BiasRepresentation.cpp