Added a keyboardinterrupt catch, and a few other things