Fixed segment fault caused by misplacement of highlight processing,
which allowed it to run before the correct session had been identified