Add more safety checks for non-power 2 local dimensions