fixed issues #11, #28, #29, #30, #31, #32, #33, #34