backport requirejs fixes