Fix tests assertions that sporadically fail