Merge "Fix some bugs for robustness." into rvc-dev am: 4cbd3b7a8e am: 8477fe56d7

Change-Id: I010bb2b37184a4477ddc1b8a2435e640fd76644c