Updated and merged Joe's changes (@jnievelt) for console testing