Fix bug on border generation.