bugfix Fixes #9 and Fixes #11