Fixed run() to handle signals as intended in the original version.
Removed some embarassing code.