Fixes related to issue 44

See commit messages and discussion in issue 44 :)