Fixed issue when using custom RequireJS loader

More info here https://github.com/kriskowal/q/pull/391