The end of the episode, inside Peter's brain, is a reference to The Twilight Zone (1959) episode Time Enough at Last (1959)
While Peter plays the theme to The X-Files (1993) solo on the piano, the arrangement on the soundtrack is impossible to play without three hands.
First time Peter stubs his knee and responds with his signature "sssss...aaaaahhhh"
A caricature of Seth McFarlane appears in the background next to Mary Tyler Moore as she throws her hat in the air.