Added fix and test for bug #8
Merge branch 'bugfix-#8' into develop