Fixed NPE in region processing.