Fix authentication bugs, add login checkbox