Login fix + better error handling