fixed #40, fixed #39, fixed #38, fixed #35, fixed #29