bugfix Issue #8, Issue #3, Issue #1