This fixes #42 and resolves #40