Fix code generation to work under mono without defining SILVERLIGHT, which causes other problems.
Fix a test.