fixed bug in example
new test + fix #1