Fixes to demo code in index.php