add default empty start target when it's absent, add flags to control background/foreground mode