Fix incorrect variable reference in code example for documentation.
Add example of decorator with optional arguments to documentation.