Added graceful shutdown on SIGHUP

You are right, during development it was calling other things. I'll clean it.