Some background/foreground fixes