Fixes to accomodate angular 1.2