fix some problems with console commands
fix view()
don't call setDebug until environment is resolved