Add unit tests for $serviceScope.$update and fix a bug that exposed.