fix #128, #129, #130