Updates and bug fixes.

Change-Id: I5d4475f56eafc4a4c537bf87588d5d2ed48049e9