Added limited handling of logarithms.