console functions, various tweaks and fixes