fixes #40, fixes #23