fix some snippet bugs