Correct html dir detection