Make output() extensible. #857