Merge pull request #1 from fruffl/master

init
error trapping
Merge pull request #2 from dunetje/master

error trapping