After Leonard catches the box of Vanilla Wafers, you can see that he was reopening the box of cookies.
Leonard's hat is totally inconsistent! It goes from loosely shaped to tightly blocked, to backwards, to tightly blocked, all within one conversation. Especially watch the conversation in which he talks to Trudy about taking care of Hap as if he were a puppy while Leonard prepares to leave to go see Uncle Chester.