fix bug in is_pow2()