Linaro optimizations and fixed some problems and warnings