Some fixes to the grant unittest