Merge "Fix bug in permission grant system." into gingerbread