fix #1151, fix #1150