Fixed some of the bugs with refresh polling.