fix test bug with repeated login; database query tweak; elim TODOs for missing exceptions