Fix: Log of leaves was broken on some mysql versions.