Some code cleanup and removing warnings

Change-Id: Id2814a2a963bce361484023efbe38711f72682de