fix unconditional jump on uninitialized var
remove unused imports
fix memory cleanup
fix bug with wrong initialization

which inhibited the create of the seg.sites sumstat