Changed tocGen to use if not instead of unless.