Fix region checking (thanks PenguinDad).