Fixes #22, fixes #21