Document the guard and make it more robust

Change-Id: Iac2fea3eaa4ab52b58015bced531af8781a7252d
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>