The attached KLOGD patch is an improved version of the one you have in hg.
This also has a fix for boundary condition crash.
add nl