Added portable signalhandling