Permission fixes and slight modifiations