Fix compilation warning.

Side-effecting nullary methods are discouraged.