Fixed console detection bug