utils.repeat now handles n == 0 properly