Fixed an obvious bug in the border code