Prepare demo. Log messages and return correct values to GUI. Other corrections