fixed #37 fixed #33 fixed #36 fixed #34 fixed #17