Added error handling for v8 scripts.