Simplified the pow-of-2 check. See