Fix error when executing "mach doc"

This should fix  #4134