fix issue #6
fix issue #7
fix issue #5
apply bug fix for #5 to snippets too
fix issue #8