Fixes to logged data.

This should fix the issues of log data not being JSON serialisable that Lassi mentioned. Also removes some data logged twice, etc smaller issues.