fixes tool segfault on close
Makes the calibrator not segfault at close.