Change demo script, fix bug