Fix build errors and warnings with Linaro GCC 4.9