Add testcase from pull request #77

(cherry picked from commit 21cbe0ec4e6d1a289c1586ef756c7b90811f5b8e)