Added check to clear any old bounds before building new ones.