Some fixes again for custom.js (this time ready)