Fix bug in parsing rectangle