Some fixes to Extensions.js