Fixed bug causing regions to close suddenly.