Fixed some random bugs in functions_migration.R
Need to figure out why the variance is negative (it shouldn't be!).