fixed bugs for gapfill_georegions.R and functions.R