Bus error 10 on exit