Fix invalid session errors