Port thumb2 patch aiming to fix #156