Fix console, improve debugger