porting upgrade fixes from R2.0 to mainline

Change-Id: Ia69b372bced4c0a26cfc3edebc2c4ad0d865c954
Merge "porting upgrade fixes from R2.0 to mainline"