fixes #29, fixes #30, fixes #31, fixes #32