Shutdown returns to login screen

After trying and loving Ubuntu Mate I am constantly plagued by one persistant issue. After the system is up for a while or goes into suspend I can’t shut the computer down from the GUI because when I do it goes to the login screen instead. I have to hold down the power button to shut down the computer. Can someone please help me identify a fix for this?
FYI: Ubuntu 16.04.3 64 bit

Have you tried doing it from a script?

  echo "password" | shutdown -h now

Another resource.

https://ubuntuforums.org/

I haven't been experiencing your issue, but I've found that when you need a definite shutdown it's quite radical to open up a terminal using CTRL+ALT+T and then typing in:

init 0

Thanks for the responses to my question. I will try these ideas the next time it happens. I reinstalled it last night and it shut down okay this morning. I used the shutdown from the system menu this morning, which I don’t usually do. Usually when this happens I have used the power icon on the panel.