Fix Restangular bug in OC6, fix global variables