Fixed !count command and added signal handler