Rebase on new code from tribler_idle_run