some cleanup

avoid unessary loops, supress a bunch of errors when things go wrong
Merge pull request #1 from splitbrain/master

some cleanup