Fix log transforms (fixes #3809) [back port to 1.4.x]