Added support for rectangular and elliptic borders