fix n_times_in

Fixes #551