Fix permissions on local storage directories
Send phantom script output when failing to parse JSON