That's the point they would have known at a minimum that they were 'working around' the law, but certainly in some places (thinking UK here) the law is poorly worded. In the UK the test rules use terms like 'at the time of the test', while the term is meant to mean that the driver couldn't be prosecuted 10 months after the test if their emissions had crept up, some corporate lawyer type can use that clause to mean that what VW did is not illegal. Clearly morally incorrect, but legally okay, it should be caught by a 'no specific changes for the test / test being representative of normal running' type clause, but the diesel tests in the uk have been messed up pretty much since emissions test for diesel were introduced.