Fix more cast warnings (errors) when targetting 4.5

Change-Id: Ie07f48a90ca0f17301ca25ed7ebbdd25252b5a7d
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/38699
Tested-by: Hudson CI