Added option 'log_script_errors' for logging script errors