Fix: Segment fault on exit.