Missed a spot - the login form needed kludge_uri_for applied to it.