Cleanup some code related to logarithms.