Alot of fixes and linaro optimizations