Fixed a bug with permissions.