fix SourceRegion error and add some tests on it #144