Fix bugs from testing

Change-Id: I36c53f8dc6aa42328b4686c0f05423fd2e2417d2