Fix error that occurs when region is set to None or ''