Improved foreground/background synchronization.