Changes to allow to work with systemd