Defensive testuitls for permissions, small cleanup of permission forms handling.