Fixed for compatibility with Angular 1.2.18