fixes #17, fixes #21