Fixes for non-gui usage.