Remove warnings when compiling with Linaro 4.8.x/4.9.x toolchains.
Properly fix compile errors

Change-Id: I214988c6398d9c337022431ca7ba330cb3a57c03