Spaces changed to tabs
Fixed termination signal handling