diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp
index 1c093d94f312088f2a22df3f48db7cf9e0344d86..79bfb6fecf22dc55ce70b8146741070f04be2914 100644
--- a/src/core/file_sys/content_archive.cpp
+++ b/src/core/file_sys/content_archive.cpp
@@ -425,9 +425,6 @@ NCA::NCA(VirtualFile file_, VirtualFile bktr_base_romfs_, u64 bktr_base_ivfc_off
             } else {
                 files.push_back(std::move(dec));
                 romfs = files.back();
-                const u64 raw_size =
-                    MEDIA_OFFSET_MULTIPLIER * (header.section_tables[i].media_end_offset -
-                                               header.section_tables[i].media_offset);
             }
         } else if (section.raw.header.filesystem_type == NCASectionFilesystemType::PFS0) {
             u64 offset = (static_cast<u64>(header.section_tables[i].media_offset) *
diff --git a/src/core/file_sys/nca_patch.cpp b/src/core/file_sys/nca_patch.cpp
index 1e93000d53d411bf952f91501f289e71e8fdeade..e0111bffc4cc5ba6ee842b7967adc64a4f3fb5df 100644
--- a/src/core/file_sys/nca_patch.cpp
+++ b/src/core/file_sys/nca_patch.cpp
@@ -50,7 +50,7 @@ size_t BKTR::Read(u8* data, size_t length, size_t offset) const {
     }
 
     if (!bktr_read) {
-        ASSERT_MSG(section_offset > ivfc_offset, "Offset calculation negative.");
+        ASSERT_MSG(section_offset >= ivfc_offset, "Offset calculation negative.");
         return base_romfs->Read(data, length, section_offset - ivfc_offset);
     }
 
@@ -118,7 +118,7 @@ std::pair<size_t, size_t> BKTR::SearchBucketEntry(u64 offset, BlockType block,
 
     size_t bucket_id = std::count_if(block.base_offsets.begin() + 1,
                                      block.base_offsets.begin() + block.number_buckets,
-                                     [&offset](u64 base_offset) { return base_offset < offset; });
+                                     [&offset](u64 base_offset) { return base_offset <= offset; });
 
     const auto bucket = buckets[bucket_id];
 
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp
index fa2fbe5e1ff94a68cc3868195138f9c04c0eab49..40675de35bd0a15b7eafe6faa029f5aaeb1c3c43 100644
--- a/src/core/file_sys/patch_manager.cpp
+++ b/src/core/file_sys/patch_manager.cpp
@@ -2,10 +2,13 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
+#include "core/file_sys/content_archive.h"
 #include "core/file_sys/control_metadata.h"
 #include "core/file_sys/patch_manager.h"
 #include "core/file_sys/registered_cache.h"
+#include "core/file_sys/romfs.h"
 #include "core/hle/service/filesystem/filesystem.h"
+#include "core/loader/loader.h"
 
 namespace FileSys {
 
diff --git a/src/core/file_sys/patch_manager.h b/src/core/file_sys/patch_manager.h
index c2626bc6cc33da247c8f4f92df9e2744cd1a0aa2..28c7ae1363460abdaee8c718cefc2de1f7478a52 100644
--- a/src/core/file_sys/patch_manager.h
+++ b/src/core/file_sys/patch_manager.h
@@ -8,7 +8,6 @@
 #include <string>
 #include "common/common_types.h"
 #include "core/file_sys/nca_metadata.h"
-#include "core/file_sys/romfs_factory.h"
 #include "core/file_sys/vfs.h"
 
 namespace FileSys {
diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp
index 33ec62491a3bd0d1a5039fcf98ee44feed713f9c..d9d90939eb81bc04e0520bbf71e571a61c43f391 100644
--- a/src/core/file_sys/romfs_factory.cpp
+++ b/src/core/file_sys/romfs_factory.cpp
@@ -12,6 +12,7 @@
 #include "core/file_sys/patch_manager.h"
 #include "core/file_sys/registered_cache.h"
 #include "core/file_sys/romfs_factory.h"
+#include "core/hle/kernel/process.h"
 #include "core/hle/service/filesystem/filesystem.h"
 #include "core/loader/loader.h"
 
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index e9d5bd7748d6c560b7410c488fe96cd1bfb70975..04c9d750fd455d0941ce4a66d7e5bd580b5153c0 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -10,6 +10,7 @@
 #include "core/file_sys/bis_factory.h"
 #include "core/file_sys/errors.h"
 #include "core/file_sys/mode.h"
+#include "core/file_sys/registered_cache.h"
 #include "core/file_sys/romfs_factory.h"
 #include "core/file_sys/savedata_factory.h"
 #include "core/file_sys/sdmc_factory.h"
@@ -19,7 +20,6 @@
 #include "core/hle/service/filesystem/fsp_ldr.h"
 #include "core/hle/service/filesystem/fsp_pr.h"
 #include "core/hle/service/filesystem/fsp_srv.h"
-#include "filesystem.h"
 
 namespace Service::FileSystem {
 
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp
index 729b1ca088690cda0a3a2f438c6a13c2ce671765..fa43a26506ae702cc16e973ca9364a2135ce800b 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -93,7 +93,7 @@ std::string GetFileTypeString(FileType type) {
     return "unknown";
 }
 
-constexpr std::array<const char*, 57> RESULT_MESSAGES{
+constexpr std::array<const char*, 58> RESULT_MESSAGES{
     "The operation completed successfully.",
     "The loader requested to load is already loaded.",
     "The operation is not implemented.",
@@ -143,7 +143,7 @@ constexpr std::array<const char*, 57> RESULT_MESSAGES{
     "The AES Key Generation Source could not be found.",
     "The SD Save Key Source could not be found.",
     "The SD NCA Key Source could not be found.",
-    "The NSP file is missing a Program-type NCA."};
+    "The NSP file is missing a Program-type NCA.",
     "The BKTR-type NCA has a bad BKTR header.",
     "The BKTR Subsection entry is not located immediately after the Relocation entry.",
     "The BKTR Subsection entry is not at the end of the media block.",
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 80a28451334e3edfb2c031c792328c1f40063378..dbe5bd8a4f6bac6ce849d062bea58ab7dbdcd4ad 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -32,6 +32,8 @@
 #include "core/crypto/key_manager.h"
 #include "core/file_sys/card_image.h"
 #include "core/file_sys/content_archive.h"
+#include "core/file_sys/control_metadata.h"
+#include "core/file_sys/patch_manager.h"
 #include "core/file_sys/registered_cache.h"
 #include "core/file_sys/savedata_factory.h"
 #include "core/file_sys/submission_package.h"