Fixed an issue where perimeter was being updated multiple times when not necessary.