Fix 'Create tab after/before' function