Permissions and JS bug fixes.