Fixed an exception in linq formatting.
Corrected a few unit tests.