Bug fix for meging gaps