Tweak JS changePermissions for backslash/windows issue