Adding autostart, mostly from stock version.