Fixes based on comments.

- Change function to private.
- Use private variable correctly.