Remove redundant typecasts for borders.