Fixing up some authentication errors and removing commented code