Minor issues and fixes

See commit messages. This fixes the issue raised in #24.