Fix bug in parsing rectangles