Yep, that's what I overlooked, thanks. And why did I overlook it? Because I didn't get a message in the XCode debug window that the program terminated... Strange. That's why I thought it was waiting for input... Silly me!
EDIT: The program does terminate but after some 30 seconds or so of being idle after the last output...