Fixes for console API and ANSI support