fixes #21, fixes #29