bugfix issue 1 and 3

fixes #1 and #3