Merge PR 40, fixes issue 39