Fixed issue when using custom RequireJS loader