improved debugging and error handling

fixes #94
Prepare new version

see #94