Fixed minor detection bug