fix some bugs when running grunt