fixed #71
fixed #73
oops forgot debug logging
fixed #72
fixed #24
Merge pull request #74 from Sebsebeleb/master

bug fixes