A few fixes and resolve #4
Merge pull request #8 from florianv/issue-4

A few fixes and resolve #4