Added RECT and cleanups