More detection fixes