Fixed ToArray calls in linq queries