If the 1wirecount function returns a wrong (higher) number of devices, try decreasing the pull-up resistor between Vcc and the data line.
Just tested on my DS18B20 network :-) Going from 4k7 to 2x4k7 in parallel solved the device enumeration error.