Various fixes following permissions test