Yeah, it is a bug. (See my reply above).

A patch to fix the bug is very welcome