fixes #232, fixes #229, fixes #236, fixes #244