Sync of latest code from Aaron.