The consequences of a discontinuity in the migration rate and of a geographical barrier in the habitat are studied in a diffusion model of migration and selection. The treatment is restricted to a single diallelic locus in a monoecious population in the absence of mutation and random drift. It is supposed further that migration is independent of genotype, the population density remains constant and uniform, and Hardy-Weinberg proportions obtain locally. It is shown that a discontinuity in the migration rate leads to a jump in the slope of the gene frequency, but not in the gene frequency itself, while a localized geographical barrier has precisely the opposite effect. These features of the gene frequency behavior are quantitatively related to the migration rate. The influence of the above inhomogeneities in migration on the maintenance of an allele in an environmental pocket is examined. The extent to which the critical condition for polymorphism is made less stringent by decreased migration outside the pocket and by a geographical barrier between the pocket and the rest of the habitat is evaluated.