Bug Fixes in new authentication model