Fixed two bugs that broke the keystore granting mechanism
am: 3f30364811  -s ours

Change-Id: Ic609567e96d7f8eb2d80c6461fa81f958b5d2c2a