Correct some syntax and catch KeyboardInterruptException when waiting for a non-debug line