Fix Primary Key problems.

Signed-off-by: Benjamin <benchisa@gmail.com>