Fixed a bug about regarding $http.
Merge with upstream/master