Tony makes a reference to Jeannie previously transporting him back to the wild west and to fighting pirates and Captain Kidd. These incidents were depicted in episodes 7 and 25 respectively. Episode 7 immediately preceded this one, but 25 was broadcast 2½ months later. The writing/filming order is obviously not the broadcast order.
When Jeannie first reads out of "Arabian Nights", the book Tony gave her as a gift to study, she reads "and the genie bowed low & said to Aladdin, my wish is your command". When in fact it should say, "your wish is my command.