Fixing boundary extraction