BackgroundTasks fixes and cleanup