Bug correction in logic