Fix some bugs + periodic tasks + download pending changes