Fixing bugs in gapfilling