Use proper getter.

This is the same feature as the upstream project has in this commit:

8b4f7d4a184e99bcccab49d92449696778f8c288