diff --git a/app/src/main/java/me/zhanghai/android/files/compat/KotlinCompat.kt b/app/src/main/java/me/zhanghai/android/files/compat/KotlinCompat.kt
index b9066c1dc..cadc64136 100644
--- a/app/src/main/java/me/zhanghai/android/files/compat/KotlinCompat.kt
+++ b/app/src/main/java/me/zhanghai/android/files/compat/KotlinCompat.kt
@@ -6,5 +6,11 @@
 package me.zhanghai.android.files.compat
 
 import kotlin.comparisons.reversed as kotlinReversed
+import kotlin.collections.removeFirst as kotlinRemoveFirst
+import kotlin.collections.removeLast as kotlinRemoveLast
 
 fun <T> Comparator<T>.reversedCompat(): Comparator<T> = kotlinReversed()
+
+fun <T> MutableList<T>.removeFirstCompat(): T = kotlinRemoveFirst()
+
+fun <T> MutableList<T>.removeLastCompat(): T = kotlinRemoveLast()
diff --git a/app/src/main/java/me/zhanghai/android/files/filejob/FileJobService.kt b/app/src/main/java/me/zhanghai/android/files/filejob/FileJobService.kt
index 962255620..faa013ac4 100644
--- a/app/src/main/java/me/zhanghai/android/files/filejob/FileJobService.kt
+++ b/app/src/main/java/me/zhanghai/android/files/filejob/FileJobService.kt
@@ -20,6 +20,7 @@ import me.zhanghai.android.files.util.WakeWifiLock
 import me.zhanghai.android.files.util.removeFirst
 import java.util.concurrent.Executors
 import java.util.concurrent.Future
+import me.zhanghai.android.files.compat.removeFirstCompat
 
 class FileJobService : Service() {
     private lateinit var wakeWifiLock: WakeWifiLock
@@ -39,7 +40,7 @@ class FileJobService : Service() {
         instance = this
 
         while (pendingJobs.isNotEmpty()) {
-            startJob(pendingJobs.removeFirst())
+            startJob(pendingJobs.removeFirstCompat())
         }
     }
 
diff --git a/app/src/main/java/me/zhanghai/android/files/provider/common/ByteStringListPath.kt b/app/src/main/java/me/zhanghai/android/files/provider/common/ByteStringListPath.kt
index d31cf30c4..733ad01d5 100644
--- a/app/src/main/java/me/zhanghai/android/files/provider/common/ByteStringListPath.kt
+++ b/app/src/main/java/me/zhanghai/android/files/provider/common/ByteStringListPath.kt
@@ -7,18 +7,19 @@ package me.zhanghai.android.files.provider.common
 
 import android.os.Parcel
 import android.os.Parcelable
+import java.net.URI
 import java8.nio.file.InvalidPathException
 import java8.nio.file.Path
 import java8.nio.file.ProviderMismatchException
+import kotlin.math.min
 import me.zhanghai.android.files.compat.readBooleanCompat
+import me.zhanghai.android.files.compat.removeLastCompat
 import me.zhanghai.android.files.compat.writeBooleanCompat
 import me.zhanghai.android.files.compat.writeParcelableListCompat
 import me.zhanghai.android.files.util.endsWith
 import me.zhanghai.android.files.util.hash
 import me.zhanghai.android.files.util.readParcelableListCompat
 import me.zhanghai.android.files.util.startsWith
-import java.net.URI
-import kotlin.math.min
 
 abstract class ByteStringListPath<T : ByteStringListPath<T>> : AbstractPath<T>, Parcelable {
     protected val separator: Byte
@@ -132,8 +133,7 @@ abstract class ByteStringListPath<T : ByteStringListPath<T>> : AbstractPath<T>,
                     if (normalizedSegments.last() == BYTE_STRING_DOT_DOT) {
                         normalizedSegments += segment
                     } else {
-                        @OptIn(ExperimentalStdlibApi::class)
-                        normalizedSegments.removeLast()
+                        normalizedSegments.removeLastCompat()
                     }
                 }
             } else {