Runtime and logging code.