Prevent duplicate grants being created. TODO: Add more tests.