Merge pull request #9 from wtfil/master

fixed proporty setting
improved error handling