fixes to make data collection robust.
update comment.