Set calculations right in setOutput.