Fixed some issues with the background task