Fixed problems so pages route correctly