Fixing conflicts to merge from upstream

Change-Id: Id1dabe9e939a214fe4a1ee18cd00445fc3e64d95