Bug fixes to ensure that resource inlining with r.js works properly