fixed typos and debug output