Rectangle bug fix