Added debug
Added proper output device handling
Authored by: vladr 2002-02-04
Parent: [r260]
Child: [r262]