Added extra checks for compiling.

Change-Id: Ie92a67a8603a59b6237137d69d512e7654fb2059