Pulled from git://console.git.sourceforge.net/gitroot/console/console