fixed typos and remove trace/debug code