login fix, typos, code cleanup