Fix JavaScript errors in example.js and documentation.js