Fixed auth bug.
Improved auth return.
Merge branch 'test' into dev