       # the game for the last one.
     displayError("Game not found for requestIds: " + requestIds) unless game
     Session.set("gameId", game._id)
-    noughts.state.changeState(noughts.state.PLAY)
+    noughts.state.changeState(noughts.state.PLAY, noughts.UrlBehavior.PUSH_URL)
   else if path == "new"
-    noughts.state.changeState(noughts.state.NEW_GAME_MENU)
+    noughts.state.changeState(noughts.state.NEW_GAME_MENU,
+        noughts.UrlBehavior.PRESERVE_URL)
   else if path == ""
     # TODO(dthurn): If the user is logged in, display their game list instead
     # of the new game promo
-    noughts.state.changeState(noughts.state.INITIAL_PROMO)
+    noughts.state.changeState(noughts.state.INITIAL_PROMO,
+        noughts.UrlBehavior.PRESERVE_URL)
   else # For simplicity, assume any unrecognized path is a game id
     Meteor.call "validateGameId", path, (err, gameExists) ->
       if err then throw err

      if noughts.state.hasPreviousState()
        noughts.state.popState()
      else
        noughts.state.changeState(noughts.state.INITIAL_PROMO)

    $(".nUrlInviteButton").on "click", ->
      Meteor.call "newGame", (err, gameId) ->

noughts.maybeInitialize = _.after 2, ->
  cacheFacebookData() if Session.get("useFacebook")
  Meteor.subscribe("myGames", onSubscribe)

  $(window).on "popstate", ->
    setStateFromUrl()

# Inspects the URL and sets the initial game state accordingly.
setStateFromUrl = ->
