Code runs. Segmentation fault on exit.