Cleaning things up and auth check.