Bugfixes for creating a new log entry.
Added some debug stuff.