Fix Pregel bug