Properly check for tmpavatar, invalidate cache, fix debug msgs