RPC and DB fixes.

Change-Id: Ibb11047067581d905e03d4dfef5aa6bcb92f5874