Get segmentation fault at the exit. Everything else seems good.