Fix memory issues according to Valgrind
Merge branch 'master' into interrupts

Conflicts:
	lci-sim/MachineInstance.cpp