Fix bugs on CGRect