[demos] demo2 and fixes of demo1