Fix cause of crashes on deleting buildings affecting the settlement range.