prevent dereferencing null pointer in certain circumstances.
fix out of bounds memory access.
only load stats tree if not in recipe mode.
fix use of uninitialised variable.
fix call to smac commpressor (entropy log was scalar instead of vector).