bug fixes in dilution.c