0 is incorrectly considered a power of 2 in function IsPowerOf2