improve debug outputter, error outputter, fix endswidth function in compiler