Fix for when running in console.