Add check for zero probability