Fix can't reboot and shutdown bug