Fixed another bug in rect