fixes #25, fixes #26, fixes #27