fixed typos
fixed handling of num_captures=None (infinite loop state)