foreach returns NULL as expected, plus some diff3 / side bugfixes