Fix editing permalink settings; add session creation tests