fix #96, #97, #98, #102, #105