Williams scores 26 as Nets top Pistons 99-96