Fix to several permission issues