Bugfixes fixes #24, fixes #25