fixed #80, fixed #79, fixed #78, fixed #77