Bug fixing, add test demo