Made code compliant with gcc -pedantic
Attempted to add better SIGINT handling

It failed. Still needs work.