Fix buggy implementation of log2_ri and clz.