Fixes and more comments.

- Fixing scope in clear method.
- Adding comments.

Signed-off-by: Robert Weber <closingtag@gmail.com>