Added a diff to add a test to this into HEAD@git. I'm happy to help solving this bug, accordingly with my own limitations.