Fix shutdown and reboot