fix issue 35

(cherry picked from commit 84b6dd5cae272e0b40877eedcea7512ddc7b5a6f)
Added test for issue #35

(cherry picked from commit 5ab532ca7fd2497e47bd83d6286af153e1f40ca3)
more tests and indention fixes
updated changes.txt

fixed #35
closes #36