Adds slightly more safety to the stats collector
Adds a signal handler to imgd