Fix target detection