.net compatibility, formatting fixes, minor other fixes