Fixing bug in simultaneous gapfilling