fixed null pointer error, fixed key column type bug

Change-Id: I2bdd37d0d5e7f2fa2f5c70bdb68ac9798a7e8a67