Fixed keyboardinterrupt behaviour