Fix 'undefined variable output' error

Partial fix for Issue #21