diff --git a/src/commands/nucleus/premium.ts b/src/commands/nucleus/premium.ts
index 2f20d2e..e0d8d8d 100644
--- a/src/commands/nucleus/premium.ts
+++ b/src/commands/nucleus/premium.ts
@@ -9,7 +9,7 @@
 
 const callback = async (interaction: CommandInteraction): Promise<void> => {
     await interaction.reply({embeds: LoadingEmbed, ephemeral: true})
-    const member = await (await interaction.client.guilds.fetch("684492926528651336")).members.fetch(interaction.user.id)
+    const member = (await interaction.client.guilds.fetch("684492926528651336")).members.cache.get(interaction.user.id)
     const firstDescription = "\n\nPremium allows your server to get access to extra features, for a fixed price per month.\nThis includes:\n" +
         "- Attachment logs - Stores attachments so they can be viewed after a message is deleted.\n" +
         "- Ticket Transcripts - Gives a link to view the history of a ticket after it has been closed.\n"
diff --git a/src/commands/settings/tracks.ts b/src/commands/settings/tracks.ts
index 612d069..8d2d59d 100644
--- a/src/commands/settings/tracks.ts
+++ b/src/commands/settings/tracks.ts
@@ -152,7 +152,7 @@
     let closed = false;
     do {
         const editableRoles: string[] = current.track.map((r) => {
-            if(!(roles.get(r)!.position >= (interaction.member as GuildMember).roles.highest.position)) return roles.get(r)!.name;
+            if(!(roles.get(r)!.position >= (interaction.member as GuildMember).roles.highest.position) || interaction.user.id === interaction.guild?.ownerId) return roles.get(r)!.name;
         }).filter(v => v !== undefined) as string[];
         const selectMenu = new ActionRowBuilder<StringSelectMenuBuilder>()
             .addComponents(
@@ -217,7 +217,10 @@
             )
             .setStatus("Success")
 
-        interaction.editReply({embeds: [embed], components: [roleSelect, selectMenu, buttons]});
+        let comps: ActionRowBuilder<RoleSelectMenuBuilder | ButtonBuilder | StringSelectMenuBuilder>[] = [roleSelect, buttons];
+        if(current.track.length >= 1) comps.splice(1, 0, selectMenu);
+
+        interaction.editReply({embeds: [embed], components: comps});
 
         let out: ButtonInteraction | RoleSelectMenuInteraction | StringSelectMenuInteraction | null;
 
@@ -233,9 +236,9 @@
 
         if(!out) return;
         if (out.isButton()) {
-            out.deferUpdate();
             switch(out.customId) {
                 case "back": {
+                    out.deferUpdate();
                     closed = true;
                     break;
                 }
@@ -244,14 +247,17 @@
                     break;
                 }
                 case "reorder": {
+                    out.deferUpdate();
                     current.track = (await reorderTracks(out, message, roles, current.track))!;
                     break;
                 }
                 case "retainPrevious": {
+                    out.deferUpdate();
                     current.retainPrevious = !current.retainPrevious;
                     break;
                 }
                 case "nullable": {
+                    out.deferUpdate();
                     current.nullable = !current.nullable;
                     break;
                 }
@@ -271,8 +277,9 @@
                     const role = out.values![0]!;
                     if(!current.track.includes(role)) {
                         current.track.push(role);
+                    } else {
+                        out.reply({content: "That role is already on this track", ephemeral: true})
                     }
-                    out.reply({content: "That role is already on this track", ephemeral: true})
                     break;
                 }
             }
@@ -330,7 +337,7 @@
                     .setCustomId("next")
                     .setEmoji(getEmojiByName("CONTROL.RIGHT", "id") as APIMessageComponentEmoji)
                     .setStyle(ButtonStyle.Primary)
-                    .setDisabled(page === Object.keys(tracks).length - 1),
+                    .setDisabled(page === tracks.length - 1),
                 new ButtonBuilder()
                     .setCustomId("add")
                     .setLabel("New Track")
diff --git a/src/index.ts b/src/index.ts
index a3a8d38..306ca50 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -13,6 +13,9 @@
     } else {
         client.fetchedCommands = await client.application?.commands.fetch()!;
     }
+    setInterval(async () => {
+        await client.database.premium.checkAllPremium();
+    }, 1000 * 60 * 3);
 });
 process.on("unhandledRejection", (err) => { console.error(err) });
 process.on("uncaughtException", (err) => { console.error(err) });
diff --git a/src/utils/commandRegistration/register.ts b/src/utils/commandRegistration/register.ts
index 0ff04b3..693ad00 100644
--- a/src/utils/commandRegistration/register.ts
+++ b/src/utils/commandRegistration/register.ts
@@ -214,6 +214,8 @@
             await guild.commands.set(commandList);
         } else {
             console.log(`${colors.blue}Registering commands in production mode${colors.none}`)
+            const guild = await client.guilds.fetch(config.developmentGuildID);
+            await guild.commands.set([]);
             await client.application?.commands.set(commandList);
         }
     }
