fixing bugs from DarTar's feedback

Change-Id: Ic27656299347a63763735cff5ac4cbd58d183d84