Updated to use new Rectangle API.