Bugfixes to log migration