Fixed region issues, but may need optimization.