Fixes to make it compile with linaro 4.7 toolchain