fix possible use of uninitialized value
properly install signal handler
Merge pull request #1 from rmartinjak/master

merge from origin