fix #127, fix #126, fix #125