Update gitignore for functional test dir, fix some bug and add more test