Auto rename 'output' and other bug fixes.