issue #998 fixed + test. Xqua nice catch and thanks.